
project(kdsm)

if (CMAKE_BUILD_TYPE STREQUAL "")
  # CMake defaults to leaving CMAKE_BUILD_TYPE empty. This screws up
  # differentiation between debug and release builds.
  set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: None (CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif ()

set(KDSM_EXPORTS TRUE)

# Header Files
set (HEADER_FILES
	./include/kdtree_prerequisites.h
	./include/kdtree_node.h
	./include/kdtree_scene_manager.h 
	./include/kdtree_scene_manager_plugin.h
	./include/kdtree_scene_node.h 
)

set (SOURCE_FILES
	./src/kdtree_node.cpp
	./src/kdtree_scene_manager.cpp
	./src/kdtree_scene_manager_dll.cpp 
	./src/kdtree_scene_manager_plugin.cpp
	./src/kdtree_scene_node.cpp
)

# Set target properties
set(CMAKE_DEBUG_POSTFIX "_d")


# Set include search path
include_directories(${DEPENDENCIES_OGRE_INCLUDE_DIR})
include_directories(${KDSM_INCLUDE_DIR})
add_definitions(-D_USRDLL)

# Build target
add_library(Plugin_KDTreeSceneManager SHARED ${HEADER_FILES} ${SOURCE_FILES})
target_link_libraries(Plugin_KDTreeSceneManager OgreMain)

# Output directory
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${RT_BUILD_DIR}/lib")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${RT_BUILD_DIR}/lib")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${RT_BUILD_DIR}/bin")


